jade.content.lang
Class Codec

java.lang.Object
  |
  +--jade.content.lang.Codec
Direct Known Subclasses:
JCodec, LEAPCodec

public abstract class Codec
extends java.lang.Object

Author:
Federico Bergenti - Universita` di Parma

Inner Class Summary
static interface Codec.CodecException
          Class CodecException.
 
Constructor Summary
Codec(java.lang.String name)
          Constructor
 
Method Summary
abstract  AbsContentElement decode(byte[] content)
          Decodes the content to an abstract description.
abstract  AbsContentElement decode(Ontology ontology, byte[] content)
          Decodes the content to an abstract description.
abstract  byte[] encode(AbsContentElement content)
          Encodes a content into a byte array.
abstract  byte[] encode(Ontology ontology, AbsContentElement content)
          Encodes a content into a byte array.
 java.lang.String getName()
          Gets the name of the codec.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Codec

public Codec(java.lang.String name)
Constructor
Parameters:
name - the name of the Codec.
Method Detail

decode

public abstract AbsContentElement decode(byte[] content)
                                  throws Codec.CodecException
Decodes the content to an abstract description.
Parameters:
content - the content as a byte array.
Returns:
the content as an abstract description.
Throws:
Codec.CodecException -  

encode

public abstract byte[] encode(AbsContentElement content)
                       throws Codec.CodecException
Encodes a content into a byte array.
Parameters:
content - the content as an abstract descriptor.
Returns:
the content as a byte array.
Throws:
Codec.CodecException -  

encode

public abstract byte[] encode(Ontology ontology,
                              AbsContentElement content)
                       throws Codec.CodecException
Encodes a content into a byte array.
Parameters:
ontology - the ontology
content - the content as an abstract descriptor.
Returns:
the content as a byte array.
Throws:
Codec.CodecException -  

decode

public abstract AbsContentElement decode(Ontology ontology,
                                         byte[] content)
                                  throws Codec.CodecException
Decodes the content to an abstract description.
Parameters:
ontology - the ontology.
content - the content as a byte array.
Returns:
the content as an abstract description.
Throws:
Codec.CodecException -  

getName

public java.lang.String getName()
Gets the name of the codec.
Returns:
the name of the codec.